package com.example.touch.location;

import android.graphics.Point;

public class PointLocation2D extends AbstractLocation
{
	private Point point;
	
	public PointLocation2D(Point point)
	{
		this.point = point;
	}
	
	public PointLocation2D(int x, int y)
	{
		this.point = new Point(x, y);
	}
	
	@Override
	protected boolean handleIsWithin(Point currentPos, int radius) 
	{
		if (currentPos.equals(point))
			return true;
		
		double dist = calcDistance(currentPos, point);
		return dist <= radius;
	}
}
